import Vue from 'vue'
import App from './App.vue'
import router from './router'
import toast from '@/common/utils/toast.js'
// import '@/lib/es6-promise.min.js'
// import '@/lib/aliyun-oss-sdk-6.13.0.min.js'
// import '@/lib/aliyun-upload-sdk-1.5.2.min.js'


// import Vconsole from 'vconsole'
import './directive/preventReClick' //防多次点击，重复提交
import 'amfe-flexible'
import 'amfe-flexible/index.js'
import 'lib-flexible'

import '@/styles/index.less' // global css
import '@/permission' 
import 'element-ui/lib/theme-chalk/index.css'
import '@/common/utils/rem'

import store from './store'
import {
  Lazyload,
  Toast,
  Button,
  Icon,
  SwipeCell,
  Swipe,
  SwipeItem,
  Card,
  Divider,
  Badge,
  Overlay,
  Popup,
  PullRefresh,
  List,
  Search,
  Cell,
  Tab,
  Tabs,
  Stepper,
  Field,
  ActionSheet 
} from 'vant'
import {
  CountDown,
  Col,
  Row,
  Tag,
  Loading,
  Dialog,
  RadioGroup,
  Radio,
  Checkbox,
  CheckboxGroup,
  CellGroup,
  Progress,
  NoticeBar,
  Uploader 
} from 'vant'

Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Col)
Vue.use(Row)
Vue.use(SwipeCell)
Vue.use(Stepper)
Vue.use(Overlay)
Vue.use(Tag)
Vue.use(Popup)
Vue.use(Loading)
Vue.use(Dialog)
Vue.use(Divider)
Vue.use(Field)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Cell)
Vue.use(CellGroup)
Vue.use(Progress)
Vue.use(NoticeBar)
Vue.use(Badge)
Vue.use(Swipe)
Vue.use(SwipeItem)
Vue.use(Uploader) 
Vue.use(ActionSheet) 
import { Image as VanImage } from 'vant'

Vue.use(Lazyload, {
  lazyComponent: true,
})
Vue.prototype.$toast = toast
Vue.use(Toast)
  .use(Button)
  .use(Icon)
  .use(SwipeCell)
  .use(Card)
  .use(VanImage)
Vue.use(Divider)
  .use(Badge)
  .use(Overlay)
  .use(Popup)
  .use(PullRefresh)
  .use(List)
Vue.use(Search)
Vue.use(CountDown)
  .use(Tabs)
  .use(Tab)
  .use(Stepper)
  .use(Field)

import { Table, TableColumn } from 'element-ui'
Vue.use(Table)
Vue.use(TableColumn)

// 拖拽
import VueDND from 'awe-dnd'
Vue.use(VueDND)

// 忽略打开微信小程序的组件
const isProduction = process.env.NODE_ENV == 'prod'
Vue.config.ignoredElements = ['wx-open-launch-weapp']
// if (!isProduction) {
//   let vConsole = new Vconsole()
//   Vue.use(vConsole)
// }
Vue.config.productionTip = false

// import Router from 'vue-router'

// const originalPush = Router.prototype.push
// Router.prototype.push = function push(location, onResolve, onReject) {
//   if (onResolve || onReject)
//     return originalPush.call(this, location, onResolve, onReject)
//   return originalPush.call(this, location).catch((err) => err)
// }
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
